package com.fashion.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: juventus
 * Date: 11-5-26
 * Time: 下午10:35
 */
public interface BaseDao {
    void saveOrUpdate(Object object);

    void delete(Object object);

    void deleteAll(Collection collection);

    <T extends Object> List<T> find(String hql, Object... values);

    void deleteById(String id, Class<?> clazz);

    <T extends Object> T getEntityById(Class<T> aClass, Serializable id);

    int countItems(String hql, Map<String, Object> parameters);

    <T extends Object> List<T> findItemsWithPage(String hql, Map<String, Object> parameters, int pageNumber, int pageSize);

    <T extends Object> List<T> findItems(String hql, Map<String, Object> parameters);

    void bulkDelete(final String hql, final String[] ids);

    void bulkDelete(final String hql);

    void bulkUpdate(final String hql, final String[] ids);
}
